<?

	interface Package_SmRoot{
		
		// Returns id of Root, typically u:500
		function root_id();
		
		// Returns id of Root's primary group, typically g:500
		function root_grp();
		
		// Retrieves and instantiates domain by its static id, and attempts to create it if $mkname set to true.
		// In this way creating a new domain ini in the etc dir and visiting the domain is enough to create a new domain and run it
		function initDomain($id, $mkname=false);
		
	}
	
	interface SmRoot_Session{}
	
	interface SmRoot_User{
		
		// Bool this user is root.  Returns true if user class is root or is sudoer and currently logged in as root, false otherwise.
		// This is different to pkg->is_smroot_root or smuoi_is_root(1) which only returns true if user is actually the root user.
		function is_root();
		
		// Is sudoer returns true only if user class is sudoer
		function is_sudoer();
		
		// returns user's primary group id
		function grp();
		
		// pass_check checks a passhash and salt pair and logs the user in if they check out against the user's password
		function pass_check($sha1, $salt);
		
	}
	
	interface SmRoot_Sudoer extends SmRoot_User{}
	
	interface SmRoot_Root extends SmRoot_User{}
	
	interface SmRoot_group{
		
		// Returns UID of user of which this group is primary, or false if this is not a primary group
		function primary();
		
		// Bool group will accept the member $u which must be an instantiated user
		function accept_member($u);
		
		// Returns array of uids who belong to this group
		function members();
			
		// Returns group name, or name of user if this is prmary group
		function name();
	
	}
	
	interface SmRoot_Domain{
		
		// Returns 8-char DOM_ID this row belongs to
		function dom_id();
		
		// Bool will permit Desktop access to user $u, which must be an instantiated user object;
		// Domain ownership permissions are a clone of those of the Domain's desk directory, but the mode is effectively 770
		// in that WORLD may not access the desktop
		function will_permit($u);
			
	}



?>